// 合力售后宝项目前缀
const PREFIX_HELI = '/api'

// 其他项目前缀
const PREFIX_OTHER = '/HMP_003/api'

// 获取现场维修列表 (待完成、已完成、待审核、已驳回)
export const getRepairList = (params) => {
	// 待完成、已完成、待审核
	let api = '/GetWorkerOnSiteRepairOrderList'
	
	if (params.stepnum === 4 && params.state === 2) {
		// 已驳回
		api = '/GetWorkerRepairOrderList'
	}
	
	return uni.$u.http.get(`${ PREFIX_OTHER + api }`, { params })
}

// 根据车号查询车辆维修历史记录
export const getRepairHistory = (params) => {
	return uni.$u.http.get(`${ PREFIX_OTHER }/GetRepairHistoricalOrderListByVNum`, { params })
}

// 查询车辆维修历史记录详情
export const getRepairCartDetails = (params) => {
	return uni.$u.http.get(`${ PREFIX_OTHER }/`, { params })
}

// 编辑现场详情（文本、语音等信息）
export const setAttachmentInfo = (data, token, location) => {
	return uni.$u.http.post(`${ PREFIX_HELI }/CreateAttachmentByFKId?token=${ token }&location=${ location }`, data)
}

// 删除图片
export const delImg = (data, token, location) => {
	return uni.$u.http.post(`${ PREFIX_HELI }/DeleteAttachmentById?token=${ token }&location=${ location }`, data)
}







